Enable Reactant AD through sequence discretization - #924
Conversation
db10f1e to
09f0468
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## branch/reactant-parallel-ad #924 +/- ##
===============================================================
- Coverage 91.57% 88.24% -3.33%
===============================================================
Files 146 146
Lines 7534 7495 -39
===============================================================
- Hits 6899 6614 -285
- Misses 635 881 +246
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
c4bc57f to
eca8bbf
Compare
There was a problem hiding this comment.
As mentioned in other PRs probably not needed.
There was a problem hiding this comment.
problem is that when reactant is compiling with the traced array it doesn't know the numerical values so it can't evaluate is_on the same way
| @inline _scalar_getindex(x, i) = x[i] | ||
| @inline _scalar_setindex!(x, value, i) = setindex!(x, value, i) | ||
|
|
||
| function _zero_pad_samples(A) | ||
| out = similar(A, length(A) + 2) | ||
| fill!(out, zero(eltype(A))) | ||
| for i in eachindex(A) | ||
| _scalar_setindex!(out, _scalar_getindex(A, i), i + 1) | ||
| end | ||
| return out | ||
| end |
| length(A) == 1 && (A = A[[1, 1]]) | ||
| A = _zero_pad_samples(A) |
There was a problem hiding this comment.
This one is kind of sketchy, probably not needed. What about, could the problem be the [el1 ; ... ; eln] in another PR you changes something to [el1, ..., eln]
| if length(seq) == 1 | ||
| values = sample_sequence_block(seq, 1; sampling_rule, motion_times=block_global_event_times(T0, 1, global_event_times), freq_in_phase) | ||
| return _with_adc_start_padding(values) | ||
| end | ||
| out = DiscreteSequence() |
There was a problem hiding this comment.
why define a special case for length(seq) == 1? When is this used? Also _with_adc_start_padding and _prepend_sample are probably not needed..
7f6640c to
7ea4dab
Compare
1c8ddb5 to
e8bbd9c
Compare
98cacf3 to
96387ed
Compare
96387ed to
122b9e7
Compare
Summary
KomaMRIBaseReactant extension for traced RF arrays while preserving the existing native discretization pathdiscretize,get_sim_ranges, and theBlochSimpletime iteratorValidation
16/16KomaMRIBase:767/767KomaMRICoreCPU suite:448/448KomaMRIFiles:24448/244484/4; new discretize + ADC + iterator test2/2rtol=1e-8,atol=1e-10git diff --checkStacked on #922.